/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * V3.java
 *
 * Created on 14-may-2012, 12:45:04
 */
package practtica4;

/**
 *
 * @author usuario_local
 */
public class V3 extends javax.swing.JFrame {

    
    
    int iddoc;
    /** Creates new form V3 */
    public V3() {
        initComponents();
    }

    V3(int titulo) {
        iddoc=titulo;
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        botonTerminar = new javax.swing.JButton();
        botonAnyaColectivo = new javax.swing.JButton();
        botonAnyaPersonaje = new javax.swing.JButton();
        botonAnyaAcontecimiento = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        botonTerminar.setText("Terminar");
        botonTerminar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonTerminarActionPerformed(evt);
            }
        });

        botonAnyaColectivo.setText("Añadir colectivo");
        botonAnyaColectivo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonAnyaColectivoActionPerformed(evt);
            }
        });

        botonAnyaPersonaje.setText("Añadir personaje");
        botonAnyaPersonaje.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonAnyaPersonajeActionPerformed(evt);
            }
        });

        botonAnyaAcontecimiento.setText("Añadir acontecimineto");
        botonAnyaAcontecimiento.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonAnyaAcontecimientoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(72, 72, 72)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(botonAnyaAcontecimiento)
                    .addComponent(botonAnyaColectivo)
                    .addComponent(botonAnyaPersonaje))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 83, Short.MAX_VALUE)
                .addComponent(botonTerminar)
                .addGap(31, 31, 31))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(61, 61, 61)
                .addComponent(botonAnyaPersonaje)
                .addGap(27, 27, 27)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(botonAnyaColectivo)
                    .addComponent(botonTerminar))
                .addGap(33, 33, 33)
                .addComponent(botonAnyaAcontecimiento)
                .addContainerGap(110, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void botonAnyaPersonajeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonAnyaPersonajeActionPerformed
        // TODO add your handling code here:
        V3Personaje v3p=new V3Personaje(iddoc);
        v3p.setVisible(true);
        this.dispose();
    }//GEN-LAST:event_botonAnyaPersonajeActionPerformed

    private void botonAnyaColectivoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonAnyaColectivoActionPerformed
        // TODO add your handling code here:
        V3Colectivo v3c=new V3Colectivo(iddoc);
        v3c.setVisible(true);
        this.dispose();
    }//GEN-LAST:event_botonAnyaColectivoActionPerformed

    private void botonAnyaAcontecimientoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonAnyaAcontecimientoActionPerformed
                // TODO add your handling code here:
        V3Acontecimiento v3a=new V3Acontecimiento(iddoc);
        v3a.setVisible(true);
        this.dispose();
    }//GEN-LAST:event_botonAnyaAcontecimientoActionPerformed

private void botonTerminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonTerminarActionPerformed
        // TODO add your handling code here:
        V1 v1= new V1();
        v1.setVisible(true);
        this.dispose();
}//GEN-LAST:event_botonTerminarActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(V3.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(V3.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(V3.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(V3.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new V3().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton botonAnyaAcontecimiento;
    private javax.swing.JButton botonAnyaColectivo;
    private javax.swing.JButton botonAnyaPersonaje;
    private javax.swing.JButton botonTerminar;
    // End of variables declaration//GEN-END:variables
}
